import { App, request } from 'request'

module.exports = {
  getsByReview(callback) {
    request(App.G.Server + 'v2/class/gets/review/', {}).then(ret => {
      callback(ret)
    })
  },
  getsByLive(callback) {
    request(`${App.G.Server}v2/class/gets/live/`, {}).then(ret => {
      callback(ret)
    })
  },
  getClass(data, callback) {
    request(`${App.G.Server}v2/class/get/`, data).then(ret => {
      callback(ret)
    })
  },
  getReviews(data, callback){
    request(`${App.G.Server}v2/class/reviews/`, data).then(ret => {
      callback(ret)
    })
  },
  like(data, callback) {
    request(`${App.G.Server}v2/class/like/`, data).then(ret => {
      callback(ret)
    })
  },
  apply(data, callback) {
    request(`${App.G.Server}v2/class/apply/`, data).then(ret => {
      callback(ret)
    })
  },
  autoApply(data, callback) {
    request(`${App.G.Server}v2/class/autoApply/`, data).then(ret => {
      callback(ret)
    })
  },
  getAttentions(data, callback) {
    request(`${App.G.Server}v2/register/gets/`, data).then(ret => {
      callback(ret)
    })
  },
  getVerifyCode(data, callback) {
    request(`${App.G.Server}v2/register/verifyMobile/`, data).then(ret => {
      callback(ret)
    })
  },
  checkVerifyCode(data, callback) {
    request(`${App.G.Server}v2/register/verifyCode/`, data).then(ret => {
      callback(ret)
    })
  },
  register(data, callback) {
    request(`${App.G.Server}v2/register/submit/`, data).then(ret => {
      callback(ret)
    })
  },
  ask(data, callback) {
    request(`${App.G.Server}v2/live/ask/`, data).then(ret => {
      callback(ret)
    })
  },
  host(data, callback) {
    request(`${App.G.Server}v2/live/host/`, data).then(ret => {
      callback(ret)
    })
  },
  interactions(data, callback) {
    request(`${App.G.Server}v2/live/interactions/`, data).then(ret => {
      callback(ret)
    })
  },
  replay(data, callback) {
    request(`${App.G.Server}v2/live/replies/`, data).then(ret => {
      callback(ret)
    })
  },
  getClasses(data, callback) {
    request(`${App.G.Server}v2/user/gets/`, data).then(ret => {
      callback(ret)
    })
  },
  userApply(data, callback) {
    request(`${App.G.Server}v2/user/apply/`, data).then(ret => {
      callback(ret)
    })
  },
  leaveWord(data, callback) {
    request(`${App.G.Server}v2/user/msg/`, data).then(ret => {
      callback(ret)
    })
  },
  getClassStatus(data, callback) {
    request(`${App.G.Server}v2/live/status/`, data).then(ret => {
      callback(ret)
    })
  },
  shareLogger(data, callback) {
    request(`${App.G.Server}v2/user/share/`, data).then(ret => {
      callback(ret)
    })
  },
}